package com.wave.mapper;

import com.wave.entity.Info;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface InfoMapper {

    int createInfo(Info info);
    int createInfoData(Info info);

    int alterInfoPara(Info info);
    int alterInfoData(Info info);

    int deleteInfoPara(int infoId);
    int deleteInfoData(int infoId);

    List<Info> getIndexInfo();
    List<Info> getSwiper();
    int countSwiper();
    int countIndex();
    int countInfo(@Param("type")String type, @Param("value")String value,
                  @Param("infoAuthorName")String infoAuthorName, @Param("infoTitle")String infoTitle);
    int countInfoUser();

    List<Info> searchInfoTitle(String infoTitle);
    Info getInfoDetail(Integer infoId);

    List<Info> getListContinue(@Param("type")String type, @Param("value")String value,
                               @Param("pageStart")int pageStart, @Param("pageSize")int pageSize);
    List<Info> getList(@Param("type")String type, @Param("value")String value,
                       @Param("pageStart")int pageStart, @Param("pageSize")int pageSize);
    List<Info> list(@Param("type")String type, @Param("value")String value,
                    @Param("infoAuthorName")String infoAuthorName, @Param("infoTitle")String infoTitle,
                    @Param("pageStart")int pageStart, @Param("pageSize")int pageSize);
    List<Info> getMyInfo(String infoAuthor);

    int alterInfoSwiper(@Param("infoId")int infoId, @Param("infoSwiper")String infoSwiper);
    int alterInfoIndex(@Param("infoId")int infoId, @Param("infoRank")String infoRank);
}
